package com.yugao.fintech.antelope.mps.core.channel.client;

import com.yugao.fintech.antelope.base.model.module.config.param.email.EmailTencentParam;
import com.yugao.fintech.antelope.mps.api.constatnts.ChannelCodeEnum;
import com.yugao.fintech.antelope.mps.core.channel.MsgChannel;
import org.springframework.boot.autoconfigure.mail.MailProperties;

public class EmailTencentMsgClient extends AbstractEmailMsgClient {
    @Override
    public ChannelCodeEnum channelCode() {
        return ChannelCodeEnum.EMAIL_TENCENT;
    }

    @Override
    public void init() {
        EmailTencentParam paramConfig = (EmailTencentParam) this.msgChannel.getParamConfig();
        this.mailProperties = new MailProperties();
        this.mailProperties.setPassword(paramConfig.getPassword());
        this.mailProperties.setUsername(paramConfig.getUsername());
        this.mailProperties.setHost("smtp.qq.com");
        this.initMailSender();
    }

    public EmailTencentMsgClient(MsgChannel msgChannel) {
        super(msgChannel);
    }
}
